<wxs src='@/utils/filter.wxs' module='filter'></wxs>
<template>
	<view class="list">
		<defaultImg :img="`../../static/img/default.png`" :text="`暂无数据`" v-if="list.length<=0"/>
		<view v-for="(item,index) in list" :key="index" class="box" v-else>
<!-- 		<view v-for="(item,index) in list" :key="index" @click.stop="click(item,'detail')" class="box" v-else> -->
			<view class="top" :class="item.status == 2?'ok':''">
				<view class="">订单号：{{item.platform_order_no}}</view>
				<view class="mt14">订单金额（本币）：{{filter.price(item.platform_amount,1)}}</view>
				<view class="mt14" v-if="userInfo.type != 2">运单号：{{item.ship_no}}</view>
			</view>
			<view class="flex f-a-c j-c-f btn f12 color-theme">
				<text class="bg-theme color-w" @click.stop="click(item, 'new')" v-if="item.status == 7">重新发货</text>
				<block  v-if="item.status == 5 && ((userInfo.type == 2 && item.state == 0) || (userInfo.type != 2 && item.state == 1))">
					<text class="bg-theme color-w" @click.stop="click(item, 'err')">{{userInfo.type == 2?'申请异常': '上报异常'}}</text>
					<text @click.stop="click(item,userInfo.type == 2?'send':'detail')">{{userInfo.type == 2?'发货': '签收'}}</text>
				</block>
			</view>
		</view>
		<tabbar :active="0"/>
	</view>
	
</template>

<script>
import defaultImg from '@/components/defaultImg.vue'
import tabbar from '@/components/tabbar.vue'
export default {
  name:'List',
  components:{ defaultImg, tabbar },
  props:{
    list:{
      type: Array,
      default: []
    }
  },
  data() {
    return {
      userInfo: uni.getStorageSync('userInfo'),
			active: getApp().globalData.tabCur
    }
  },
  methods:{
    click(e,type){
		this.$emit('hand',{e,type})
    }
  }
}
</script>

<style lang="scss">
.list{
		padding: 32rpx;
		background: #f5f5f5;
		min-height: 70vh;
		.box{
			background: #fff;
			padding: 30rpx 20rpx;
			border-radius: 16rpx;
			margin-bottom: 24rpx;
			.top{
				border-bottom: 2rpx dashed #f5f5f5;
				margin-bottom: 20rpx;
				padding-bottom: 28rpx;
			}
			.top.ok{
				margin-bottom: 0;
				border: 0;
				padding-bottom: 0;
			}
			.btn text{
				width: 148rpx;
				height: 56rpx;
				text-align: center;
				line-height: 56rpx;
				border: 2rpx solid var(--theme);
				margin-left: 20rpx;
				border-radius: 8rpx;
			}
		}
	}
</style>